<?php
	session_start();
	if (!isset($_SESSION["login"])) {
		header("Location: login");
	}
	$arr_localhost = array('localhost', '127.0.0.1');
	if (!in_array($_SERVER['HTTP_HOST'],$arr_localhost)) $host = "http://www.clasesonline.com.ar/sai/";
	else $host = "http://localhost/cov/sai/";
?>
<!DOCTYPE html>
<!--[if lt IE 7]>      <html lang="es" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html lang="es" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html lang="es" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="es" class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>SAI - Sistema de Administración Interno de Clases Online</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <link rel="stylesheet" href="<?php echo $host; ?>styles/normalize.css">
    <link rel="stylesheet" href="<?php echo $host; ?>styles/main.css">
    <link rel="stylesheet" href="<?php echo $host; ?>styles/common.css">

    <script src="<?php echo $host; ?>scripts/vendor/modernizr-2.6.2.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="<?php echo $host; ?>scripts/vendor/jquery-1.10.2.min.js"><\/script>')</script>
    <script src="<?php echo $host; ?>scripts/plugins.js"></script>
    <script src="<?php echo $host; ?>scripts/main.js"></script>

    <?php include("main/uri.php"); ?>
    <script>
        Sai.HOST = '<?php echo $host; ?>';
        Sai.MODULE = '<?php echo $glb_uri[0]; ?>';
    </script>
    <?php
        if ((is_array($glb_uri)) && (file_exists("modules/".$glb_uri[0]."/header.php"))) require_once("modules/".$glb_uri[0]."/header.php");
        if ((is_array($glb_uri)) && (array_key_exists(1, $glb_uri)) && (file_exists("modules/".$glb_uri[0]."/actions/".$glb_uri[1]."/header.php"))) require_once("modules/".$glb_uri[0]."/actions/".$glb_uri[1]."/header.php");
        ?>
</head>
<body>
        <!--[if lt IE 7]>
            <p class="browsehappy">Estas utilizando un explorador <strong>desactualizado</strong>. Por favor actualizalo en <a href="http://browsehappy.com/">www.browsehappy.com</a> para asegurar el correcto funcionamiento del sistema.</p>
        <![endif]-->
        <header class="clearfix" id="top-menu">
            <div class="logo">
                <a href="">
                    <h1>SAI</h1>
                    <strong>Sistema de Adminitración Interno</strong>
                </a>
            </div>
            <!--<div class="teacher-menu">
                <img src="<?php echo $host; ?>content/test-teacher.jpg" alt="Avatar"/>
                <h2><span>Prof.</span> Daviv León Maurelio</h2>
                <ul>
                    <li>
                        <a href="" class="button icon"><span class="icon calendar"></span>Calendario</a>
                    </li>
                    <li>
                        <a href="" class="button icon"><span class="icon cog"></span>Configuración</a>
                    </li>
                  <li>
                        <button class="button icon"><span class="icon logout"></span>Desconectarse</button>
                    </li>
                </ul>
            </div>
            <div class="next-class">
                <a href="">
                    <span class="icon calendar"></span>
                    <span class="subtitle">Próxima Clase</span><br>
                    <strong>Lunes 22 de ENero, 23:00hs</strong>
                </a>
            </div>-->
        </header>
        <div class="left-menu">
            <div class="search">
                <strong>Buscar</strong>
                <input type="text" placeholder="Buscar en el sistema" />
            </div>
            <div class="sidebar">
                <nav>
                    <h3>Módulos</h3>
                    <ul>
                        <li> 
                            <a href="<?php echo $host; ?>students/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'students')) echo "class='selected'"; ?>><span class="icon user"></span>Alumnos</a>
                        </li>
						<li>
							<a href="<?php echo $host; ?>groups/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'groups')) echo "class='selected'"; ?>><span class="icon users"></span>Cursos</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>calendar/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'calendar')) echo "class='selected'"; ?>><span class="icon calendar"></span>Calendario</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>lessons/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'lessons')) echo "class='selected'"; ?>><span class="icon video"></span>Clases</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>accountancy/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'accountancy')) echo "class='selected'"; ?>><span class="icon credit-card"></span>Registro de pagos</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>plans/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'plans')) echo "class='selected'"; ?>><span class="icon text-doc"></span>Planes de estudio</a>
						</li>
                        <li>
                            <a href="<?php echo $host; ?>roles/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'roles')) echo "class='selected'"; ?>><span class="icon briefcase"></span>Roles</a>
                        </li>
						<li>
							<a href="<?php echo $host; ?>configuration/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'configuration')) echo "class='selected'"; ?>><span class="icon cog"></span>Configuracion</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>files/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'files')) echo "class='selected'"; ?>><span class="icon folder"></span>Archivos</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>library/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'library')) echo "class='selected'"; ?>><span class="icon docs"></span>Mediateca</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>messages/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'messages')) echo "class='selected'"; ?>><span class="icon chat"></span>Mensajeria</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>emails/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'emails')) echo "class='selected'"; ?>><span class="icon mail"></span>Email</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>store/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'store')) echo "class='selected'"; ?>><span class="icon tag"></span>Tienda</a>
						</li>
                        <li>
                            <a href="<?php echo $host; ?>clients/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'clients')) echo "class='selected'"; ?>><span class="icon user"></span>Clientes</a>
                        </li>
                        <li>
                            <a href="<?php echo $host; ?>users/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'users')) echo "class='selected'"; ?>><span class="icon user"></span>Usuarios</a>
                        </li>
						<li>
							<a href="<?php echo $host; ?>logs/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'logs')) echo "class='selected'"; ?>><span class="icon clipboard"></span>Historial</a>
						</li>
						<li>
							<a href="<?php echo $host; ?>workshop/" <?php if ((isset($glb_uri[0])) && ($glb_uri[0] == 'workshop')) echo "class='selected'"; ?>><span class="icon pencil"></span>Tareas</a>
						</li>
                    </ul>
                </nav>
            </div>
            <footer>
                <ul>
                    <li class="">
                        <a href="<?php echo $host; ?>services/"><span class="icon tools"></span>Servicio técnico</a>
                        <span><a href="" class="button notif 1">+2</a><a href="" class="button notif 2">+5</a></span>
                    </li>
                    <li class="">
                        <a href=""><span class="icon circled-help"></span>Ayuda general</a>
                    </li>
                </ul>
            </footer>
        </div>
		<section class="module" id="module">
					<?php if (is_array($glb_uri)) require_once("modules/".$glb_uri[0]."/index.php"); ?>
		</section>

        <!-- Google Analytics: change UA-XXXXX-X to be your site's ID. 
        <script>
            (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
            function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
            e=o.createElement(i);r=o.getElementsByTagName(i)[0];
            e.src='//www.google-analytics.com/analytics.js';
            r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
            ga('create','UA-XXXXX-X');ga('send','pageview');
        </script>-->
</body>
</html>